package com.bkgy.modular.tbdsjrawcheckc642.controller;

import com.alibaba.fastjson.JSONObject;
import com.bkgy.modular.tbdsjrawcheckc642.service.AccuracyService;
import com.bkgy.modular.tbdsjrawcheckc642.service.TbDsjRawcheckC642CopyService;
import com.bkgy.modular.tbdsjrawcheckc642.service.TbDsjRawcheckC642Service;
import com.bkgy.sys.common.entity.ResultData;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/tbDsjRawcheckC642")
public class TbDsjRawcheckC642Controller {
    @Resource
    private TbDsjRawcheckC642Service tbDsjRawcheckC642Service;

    @Resource
    TbDsjRawcheckC642CopyService tbDsjRawcheckC642CopyService;

    @Resource
    AccuracyService accuracyService;

    @PostMapping("/findDataByPage")
    public ResultData findDataByPage(@RequestBody JSONObject json){
        return tbDsjRawcheckC642Service.findDataByPage(json);
    }


    @PostMapping("/findDataByPage2")
    public ResultData findDataByPage2(@RequestBody JSONObject json){
        return tbDsjRawcheckC642Service.findDataByPage2(json);
    }
    /**
     * 列表导出功能
     * @param jsonObject
     * @param response
     */
    @PostMapping("/exportXlsx")
    public void export(@RequestBody JSONObject jsonObject, HttpServletResponse response) {
        tbDsjRawcheckC642Service.export(jsonObject,response);
    }

    @PostMapping("/exportXlsxgz")
    public void exportgz(@RequestBody JSONObject jsonObject, HttpServletResponse response) {
        tbDsjRawcheckC642Service.exportgz(jsonObject,response);
    }

    @PostMapping("/findLineDataByVolumeNo")
    public ResultData findLineDataByVolumeNo(@RequestBody JSONObject json){
        return tbDsjRawcheckC642Service.findLineDataByVolumeNo(json);
    }

    /**
     * 2130酸轧质量精度结果
     * @param json
     * @return
     */
    @RequestMapping(value = "/findByPage",method = RequestMethod.POST)
    public ResultData findByPage(@RequestBody JSONObject json){
        return tbDsjRawcheckC642CopyService.findByPage(json);
    }

    /**
     * 2130酸轧精度画面和接口数据
     * @param json
     * @return
     */
    @PostMapping("/findByPopupData")
    public ResultData findByPopup(@RequestBody JSONObject json){
        return accuracyService.findByPopup(json);
    }

    /**
     * 列表导出功能
     * @param jsonObject
     * @param response
     */
    @PostMapping("/exportXlsx2")
    public void export2(@RequestBody JSONObject jsonObject, HttpServletResponse response) {
        tbDsjRawcheckC642CopyService.export(jsonObject,response);
    }

    /**
     * 厚度超差重新计算
     * @param jsonObject
     * @return
     */
    @PostMapping("/thicknessCCRecalculate")
    public ResultData thicknessCCRecalculate(@RequestBody JSONObject jsonObject) {
        return tbDsjRawcheckC642Service.thicknessCCRecalculate(jsonObject);
    }


    /**
     * 厚度超差重新计算列表查询
     * @param jsonObject
     * @return
     */
    @PostMapping("/findBYCCData")
    public ResultData findBYCCData(@RequestBody JSONObject jsonObject) {
        return tbDsjRawcheckC642Service.findBYCCData(jsonObject);
    }

    /**
     * 查询mongDb超差位置集合
     * @param jsonObject
     * @return
     */
    @PostMapping("/findByMongDbData")
    public ResultData findByMongDbData(@RequestBody JSONObject jsonObject) {
        return tbDsjRawcheckC642Service.findByMongDbData(jsonObject);
    }

    @PostMapping("/findByWightData")
    public ResultData findByWightData(@RequestBody JSONObject jsonObject) {
        return tbDsjRawcheckC642Service.findByWightData(jsonObject);
    }


    @PostMapping("/findPageList")
    public ResultData findPageList(@RequestBody JSONObject jsonObject) {
        return tbDsjRawcheckC642Service.findPageList(jsonObject);
    }


}
